<?php 
    include_once('../includes/common.inc.php');
    include_once("../dal/adminDAL.php");
    if(isset($_GET["userId_array"]))
    {
        $count = count($_GET['userId_array']);
        for ($i=0; $i<$count; $i++){ 
            $userId_array[$i] = $_GET['userId_array'][$i];
        }
        $adminDAL = new AdminDAL();
        $count = $adminDAL->deleteMembers($userId_array);
        
        if($count > 0)
        {
            header("Location:accounts.php?message=Bạn đã delete " . $count . " tài khoản thành công");
        }
        else
        {
            header("Location:accounts.php?error_message=Delete tài khoản thất bại");
        }
    }
    
?>